package au.com.langdale.gwt.client.model;

import java.io.Serializable;


import com.google.gwt.user.client.rpc.IsSerializable;

/**
 * Model is the base class for objects that 'model our problem domain'.  
 * These objects typically correspond to database records and
 * may traverse the validation, business logic user interface layers.<p> 
 * 
 * The only requirement for a Model is that it provide a link to its
 * metadata via getModelInfo(). This is for situations where model instance's
 * type is not known at compile time and no java reflection is available
 * at runtime. This is the situation in some GWT user interface code.<p>
 *  
 * @author AdV
 *
 */
public abstract class Model implements IsSerializable, Serializable {
	
	public abstract ModelInfo getModelInfo();
	
	public String validate() {
		return getModelInfo().validate(this);
	}
}
